﻿using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace FySystem.Extension
{
    public static class StringExtension
    {
        /// <summary>
        /// 如果为空，返回目标字符串
        /// </summary>
        /// <param name="source"></param>
        /// <param name="dest"></param>
        /// <returns></returns>
        public static string NVL(this string source,string dest)
        {
            return string.IsNullOrWhiteSpace(source) ? dest : source;
        }

        /// <summary>
        /// 获取GUID字符串，全部大写，并且没有-
        /// </summary>
        /// <returns></returns>
        public static string GetGUID()
        {
            return Guid.NewGuid().ToString().ToUpper().Replace("-", "");
        }
    }
}
